/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Bean;

import java.util.*;

/**
 *
 * @author Quang Thao
 */
public class CartBean {

    String ID;
    Date DateCreate;
    Date DateArrive;
    String State;
    String Type;
    AccountBean Account_ID;
    List ListBook;
    double Cost;

    public CartBean() {
        ID = null;
        DateCreate = new Date();
        DateArrive = new Date();
        State = null;
        Type = null;
        Account_ID = null;
        ListBook = new ArrayList<Bean.BookBean>();
        Cost = 0;
    }

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public Date getDateCreate() {
        return DateCreate;
    }

    public void setDateCreate(Date DateCreate) {
        this.DateCreate = DateCreate;
    }

    public Date getDateArrive() {
        return DateArrive;
    }

    public void setDateArrive(Date DateArrive) {
        this.DateArrive = DateArrive;
    }

    public String getState() {
        return State;
    }

    public void setState(String State) {
        this.State = State;
    }

    public String getType() {
        return Type;
    }

    public void setType(String Type) {
        this.Type = Type;
    }

    public AccountBean getAccount_ID() {
        return Account_ID;
    }

    public void setAccount_ID(AccountBean Account_ID) {
        this.Account_ID = Account_ID;
    }

    public List getListBook() {
        return ListBook;
    }

    public void setListBook(List ListBook) {
        this.ListBook = ListBook;
    }

    public double getCost() {
        return Cost;
    }

    public void setCost(double Cost) {
        this.Cost = Cost;
    }

    
    public double getSumCost() {
        double sum = 0;
        for (int i = 0; i < ListBook.size(); i++) {
            Bean.BookBean book = (Bean.BookBean) ListBook.get(i);
            sum += (book.getCost() * book.getQuantity());
        }
        return sum;
    }
}
